<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view');

/**
 * HTML View class for the Poll component
 *
 * @static
 * @package		Joomla
 * @subpackage	Poll
 * @since 1.0
 */
class FarmViewBase extends JView
{
	function display()
	{
		$tableArr = array(			
			'flist'	=> 'field',
			'olist'	=> 'obser',
			'plist'	=> 'plant',
			'dlist'	=> 'disease',
			'pelist'=> 'pesticide',
			'mlist'	=> 'manure',
		);
		$layout = JRequest::getVar('layout');
		
		switch($layout){
			case 'flist':
			case 'olist':
			case 'plist':
			case 'dlist':
			case 'pelist':
			case 'mlist':
				$t = JTable::getInstance($tableArr[$layout], 'Table');
				$tmp    = $t->alist();
				$this->assignRef('page',		$tmp[0]);
				$this->assignRef('data',		$tmp[1]);
				break;
			case '':
				break;
			default:
				break;
		}
		parent::display();
	}
}
